from django.urls import path
from .views import (
    LoginView, RegisterView, LogoutView, UserUpdateView,
    UserListView, UserDetailView,
    PasswordResetRequestView, PasswordResetConfirmView
)

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('register/', RegisterView.as_view(), name='register'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('update/', UserUpdateView.as_view(), name='user-update'),
    # 新增接口
    path('users/', UserListView.as_view(), name='user-list'),  # 管理员查看用户列表
    path('users/<int:pk>/', UserDetailView.as_view(), name='user-detail'),  # 用户详情
    path('password-reset/', PasswordResetRequestView.as_view(), name='password-reset'),  # 密码重置请求
    path('password-reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password-reset-confirm'),  # 确认重置
]